core: Fix the trimElements method of the OsRepo

Modifies the trimElements method of the OsRepositoryImpl class to
filter out empty elements and correctly handle properties with empty
lists as values.

Change-Id: I16f6e387c231c78b43c76055748735ae456ab0fe
Signed-off-by: Gustavo Pedrosa <gustavo.pedrosa@eldorado.org.br>