If by locked you mean private: users/show will still work for a Private account - returning a User object with: "protected":true
in the json.
If locked means Suspended, you get:
{"errors":[{"code":63,"message":"User has been suspended."}
as a response - but some libraries won’t return the full error and just throw an exception.
Deleted accounts, or ids / screen names that don’t exist return:
{"errors":[{"code":50,"message":"User not found."}]}