Redmine #6289: Disable account expiration on Solaris.

Solaris doesn't support setting an expiration date in the past, hence
we cannot rely on that method to lock an account.

Also work around an egrep bug on Solaris (doesn't accept empty
alternative expressions).
(cherry picked from commit 1a1db35f16e7a1d68f44ed4f3d3b47d137337d7a)

Conflicts:

	tests/acceptance/17_users/unsafe/user_queries.cf.sub