It will decrease the security.
decreases security because the output of MD5 is 128 bits, compared with 160 bits for SHA-1. The arbitrarily long input foo is reduced to an input of 128 bits at the final step, and you only need to find that input for a collision (independently of any MD5-specific weakness you may also have added to the mix).
When done correctly, it increases the security. It's like encrypting a file with AES and then encrypting it with Twofish and then Serpent.
The security is actually the strongest link; not the weakest.
That's why bitcoin addresses use SHA256(RIPEMD160(X)) for output into a 160 bit hash.
Concatenating the outputs of the hash functions fixes that particular issue. But concatenating makes preimage attacks easier.