Running 'encryptwallet' throws the following exception at shutdown: /usr/include/boost/thread/pthread/pthread_mutex_scoped_lock.hpp:26: boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock(pthread_mutex_t*): Assertion `!pthread_mutex_lock(m)' failed.
bitcoind exits as expected, and restarts with the newly encrypted wallet just fine.