[imp] Adding method to trim normal, non-breaking and multibyte spaces

See discussion https://github.com/joomla/joomla-cms/pull/4489

the code to use would be:
```
JFilterInput::getInstance()->clean((string) $mystring, 'trim')
```