Solo
1. Unlock the sentry gun
2. buy one and place it
3. buy another
4. press and hold X and then instantly press right on the d pad to get out your second sentry.
5. Then press X to place the first one and then place the second one and you will have an empty slot.
6. buy another gun and enjoy
Multi-player
Same
Note: This can be done as many times as you want however when you've got an empty slot make sure not to run over any weapons that you have that are on the ground as you will pick up ammo and will switch to that gun making you lose the slot.