Refactor to reduce duplicate code in mxt-app message handling

Signed-off-by: Steven Swann <steven.swann@itdev.co.uk>
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>
Add timeout to mxt-app --messages command

Signed-off-by: Steven Swann <steven.swann@itdev.co.uk>
Signed-off-by: Nick Dyer <nick.dyer@itdev.co.uk>