remove all trailing blank lines and all trailing whitespace

Tips from RIOT-OS: https://github.com/RIOT-OS/RIOT/pull/673

Remove all the trailing whitespace:
  find * -type f -exec sed -i -E 's/[[:space:]]*$//' {} \;

Remove the last trailing blank line:
  for file in $(find * -type f -exec sh -c '[ -z "$(sed -n "\$p" $1)" ] &&
  echo "$1"' _ {} \;); do
    head --lines=-1 ${file} | sponge ${file};
  done