fixed error logging problems in synchronous library calls

Synchronous code should 'return' rather than 'throw' errors. This fixes logging problems in Express where error logging wasn't logging the error messages provided by bcrypt.