Optimize netconf capability handling

Inefficient splitting, forward scans and similar. This patch
optimizes it as much as possible.

Change-Id: Ibf52b3b8f512c6b4936dca3089e73bbb1671eaa7
Signed-off-by: Robert Varga <rovarga@cisco.com>
Merge "Optimize netconf capability handling"