Fixed an unexpected exception bug when reconnecting in pub/sub mode if selected_db is not null

RedisClient might enter pub/sub mode after at least one SELECT command issued.
When reconnecting, the SELECT command is issued after restoring pub_sub_command to true, which causes an exception.

#### Ready to merge checklist
- [x] test(s) in test.js
- [x] tests will fail without the PR, but succeed once applied
- [x] docs, if applicable
- [x] merges cleanly
- [x] coding style (4-space indents, looks similar to other code)