Handle optional master password

This change allows command line switch -P to be specified, prompting
entry of a master password.