Refixed issue with parsing desired capabilities

Reapplied fix to handle colon within a value for the desired capabilities.
This had been fixed but the bug was reintroduced somewhere. Added unittest
to check for complex desired capabilities string.