MT#5929 Fix lock, ext_xxx_id and dbalias handling.

- ext_subscriber_id and ext_contract_id preferences weren't populated correctly.
- subscriber lock preference wasn't populated correctly
- old dbalias entries weren't cleared correctly for API calls