Locking the row makes no sense, the database would still be able to create new rows wth new IDs
Locking the table could help, but it not an option. MySQL has finally gotten rid of the hopelessly slow table-level-locking in version 4.0, let's not encourage people to start using it again without good reason. :-)
the mysql_insert_id is perfectly safe to use in multi-user, providing your scipts are sane.
For ex: if you use persistent connections it is possible to insert a record, stop the script, start a new script, call mysql_insert_id() and get the id of the record that the previous script inserted. But that doesnt matter because who would ever want to retreive a new record id without first insterting a new record? :-)